﻿using System;
using System.Web.Mvc;
using Microsoft.Practices.Unity;
using WebShop.Contracts;
using WebShop.DAL;
using WebShop.DAL.Interfaces;
using WebShop.Infrastructure;
using WebShop.Models;

namespace WebShop.Controllers
{
    [HandleErrors]
    public class LogController : Controller
    {
        [Dependency]
        public ILogRepository LogRepository { get; set; }

        private const int PAGE_SIZE = 20;

        //
        // GET: /Log/

        public ViewResult Index(int pageIndex = 1)
        {
            return View(LogRepository.List(pageIndex, PAGE_SIZE));
        }

        //
        // GET: /Log/Details/5

        public ViewResult Details(Int64? id)
        {
            LogItem l = LogRepository.Get(id);
            return View(l);
        }

        //
        // GET: /Log/Delete
        public ViewResult Delete()
        {
            return View();
        }

        protected override void Dispose(bool disposing)
        {
            //db.Dispose();
            base.Dispose(disposing);
        }
    }
}